<!--
 * @Author: HaoyangDu@wits.com
 * @description: 
 * @param: 
 * @return: 
-->
<template>
  <up-navbar title="我的二维码" @leftClick="back" bgColor="transparent">
  </up-navbar>
  <img src="./img/bg.png" alt="" class="bg" />
  <div class="mainArea">
    <img src="./img/wenan.png" alt="" class="title" />
    <div class="phone">
      <img src="./img/phone.png" alt="" class="phoneBg" />
      <img :src="myCode" alt="" class="code" />
      <div class="time">
        <div class="lh">2023年11月25日</div>
        <div class="lh"><span>14:30:25</span>后失效</div>
      </div>
    </div>
    <div class="userArea">
      <img src="./img/bg_02.png" alt="" class="userAreaBg" />
      <div class="userName">客户经理：<span>包子</span></div>
      <div class="baseArea">
        <img src="./img/logo.png" alt="" class="logo" />
        <div>黄山路支行</div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref, reactive, onMounted } from "vue";
import * as http from "../../utils/http";
import { useAppStore } from "../../store/index";
const store = useAppStore();
// 动态二维码
const myCode = ref("");
onMounted(() => {
  http.dynamicQRCode({ userId: store.userId }).then((res) => {
    if (res.code == 200) {
      myCode.value = "data:image/png;base64," + res.data;
    }
  });
});
// 返回上一页
const back = () => {
  wx.navigateBack();
};
</script>

<style scoped lang="scss">
.mainArea {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  .title {
    width: 484rpx;
    height: 66rpx;
  }
  .phone {
    width: 666rpx;
    height: 737rpx;
    position: relative;
    .code {
      width: 197rpx;
      height: 197rpx;
      position: absolute;
      left: 222rpx;
      top: 230rpx;
      z-index: 999;
    }
    .phoneBg {
      width: 100%;
      height: 100%;
      position: absolute;
      left: 0;
      top: 0;
      z-index: -99;
    }
    .time {
      position: absolute;
      left: 50%;
      bottom: 170rpx;
      transform: translate(-50%);
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      color: #014099;
      font-size: 20rpx;
      .lh {
        height: 36rpx;
        line-height: 36rpx;
      }
    }
  }
  .userArea {
    width: 676rpx;
    height: 267rpx;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    .userName {
      color: #3672fd;
      font-size: 30rpx;
      font-weight: 600;
      margin-bottom: 30rpx;
    }
    .baseArea {
      display: flex;
      justify-content: center;
      align-items: center;
      color: #014099;
      font-size: 20rpx;
      .logo {
        width: 225rpx;
        height: 34rpx;
        margin-right: 12rpx;
      }
    }
    .userAreaBg {
      width: 100%;
      height: 100%;
      position: absolute;
      left: 0;
      top: 0;
      z-index: -99;
    }
  }
}
.bg {
  width: 100vw;
  height: 100vh;
  position: absolute;
  left: 0;
  top: 0;
  z-index: -9999;
}
</style>
